package com.szq.day39.biz;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.szq.day39.Exception.BusinessException;
import com.szq.day39.dao.UsersDAO;
import com.szq.day39.entity.Users;
@Service
public class UsersBiz {
	@Resource
	private UsersDAO dao;
	
	public Users login(Users user) throws BusinessException{
		try {
			return dao.findByUserNameAndPassword(user.getUserName(), user.getPassword());
		} catch (Exception e) {
			e.printStackTrace();
			throw new BusinessException("E01BO6");
		}
		
		
	}

}
